package com.lyw.springCloud.controller;

import com.lyw.springCloud.domain.CommonResult;
import com.lyw.springCloud.domain.Order;
import com.lyw.springCloud.service.AccountService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Auther liyawei
 * @Date 2022/5/22 11:20
 */
@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    /**
     * 扣减账户余额
     */
    @RequestMapping("/account/decrease")
    public CommonResult decrease(@RequestBody Order order){

        accountService.decrease(order);
        return new CommonResult(200,"扣减账户余额成功！");
    }
}